home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 41
/
Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso
/
-seriously_amiga-
/
graphics
/
videoeasel
/
camrexx
/
isingii.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-04-19
|
1KB
|
38 lines
/* Microcannonical Ising Model with energy banks */
/* by an idea of Toffoli, in CAMRexx by THOR */
MakeAlgorithm:
PLANEALGORITHM neumann hvphases
return
MakePlane:
lattice=(horz=vert)
if phase=1 then lattice=~lattice
/* handle only even or odd sublattice */
if lattice then; do
bonds=north+south+east+west /* #bonds for spin down */
if center then bonds=4-bonds /* and spin up */
select
when bonds=1 & center_=1 then; do /* one bond, energy in the bank */
new=3-centers /* invert our state and the bank */
SETPLANES new
end
when bonds=2 then; do /* two bonds */
if plane=0 then; do
new=~center
SETPLANE new /* flip only spin */
end; else
SETPLANE center_ /* preserve bank */
end
when bonds=3 & center_=0 then; do /* three bonds, bank empty */
new=3-centers
SETPLANES new
end
otherwise
SETPLANES centers
end /* of select */
end; else
SETPLANES centers
return